package com.zxwl.base.dao;

import java.lang.reflect.InvocationTargetException;

import org.hibernate.property.Getter;
import org.hibernate.property.Setter;
import org.hibernate.type.AbstractType;
import org.hibernate.type.Type;

public class PropertyInfo
{
	private String propertyName; // 属性名称
	private String columnName;   // 字段名称
	private Setter setter;
	private Getter getter;
	private AbstractType typeConverter ;
	private Type type;
	
	
	public void setValue(Object entity, Object value) 
			throws IllegalArgumentException, 
			IllegalAccessException, 
			InvocationTargetException
	{
		if(null != setter)
		{
			setter.set(entity, value, null);
		}
	}
	
	public String getPropertyName()
	{
		return propertyName;
	}
	public void setPropertyName(String propertyName)
	{
		this.propertyName = propertyName;
	}
	public String getColumnName()
	{
		return columnName;
	}
	public void setColumnName(String columnName)
	{
		this.columnName = columnName;
	}
	
	public void setType(Type type)
	{
		this.type = type;
	}
	
	public Type getType()
	{
		return type;
	}

	public void setTypeConverter(AbstractType typeConverter) 
	{
		this.typeConverter = typeConverter;
	}
	
	public AbstractType getTypeConverter() 
	{
		return typeConverter;
	}
	
	public void setSetter(Setter setter) 
	{
		this.setter = setter;
	}
	
	public Setter getSetter()
	{
		return setter;
	}
	
	public void setGetter(Getter getter)
	{
		this.getter = getter;
	}
	
	public Getter getGetter()
	{
		return getter;
	}
}
